<?php
$controller_action = $this->params['controller'] . '_' . $this->params['action'];
?>
<div id="nav-wrapper">
    <div id="nav">
        <ul>
            <li<?php echo $controller_action == 'dashboard_index' ? ' class="active"' : ''; ?>><?php echo $this->Html->link('Thống kê', array('controller' => 'dashboard', 'action' => 'index')); ?></li>
            <li<?php echo $controller_action == 'bookings_index' || $controller_action == 'bookings_add' || $controller_action == 'bookings_edit' || $controller_action == 'bookings_show' || $controller_action == 'bookings_send' || $controller_action == 'booking_statuses_index' || $controller_action == 'booking_statuses_add' || $controller_action == 'booking_statuses_edit' || $controller_action == 'payment_types_index' || $controller_action == 'payment_types_add' || $controller_action == 'payment_types_edit' ? ' class="active"' : ''; ?>><?php echo $this->Html->link('Booking', array('controller' => 'bookings', 'action' => 'index')); ?></li>
            <li<?php echo $controller_action == 'customers_index' || $controller_action == 'customers_add' || $controller_action == 'customers_edit' || $controller_action == 'customers_show' ? ' class="active"' : ''; ?>><?php echo $this->Html->link('Khách hàng', array('controller' => 'customers', 'action' => 'index')); ?></li>
            <li<?php echo $controller_action == 'hotels_index' || $controller_action == 'hotels_add' || $controller_action == 'hotels_edit' || $controller_action == 'locations_index' || $controller_action == 'locations_add' || $controller_action == 'locations_edit' ? ' class="active"' : ''; ?>><?php echo $this->Html->link('Khách sạn', array('controller' => 'hotels', 'action' => 'index')); ?></li>
            <li<?php echo $controller_action == 'users_index' || $controller_action == 'users_add' || $controller_action == 'users_edit' || $controller_action == 'users_change_password' ? ' class="active last' . ($this->Session->read('Auth.User.role') == 'admin' ? '"' : ' hide"') : ' class="last' . ($this->Session->read('Auth.User.role') == 'admin' ? '"' : ' hide"'); ?>><?php echo $this->Html->link('User', array('controller' => 'users', 'action' => 'index')); ?></li>
            <br class="clr" />
        </ul>
    </div>
</div>

<div id="subnav"<?php echo $controller_action == 'users_profile' || $controller_action == 'dashboard_index' || $controller_action == 'bookings_send' ? ' class="hide"' : ''; ?>>
    <ul>
        <?php if ($controller_action == 'bookings_index' || $controller_action == 'bookings_add' || $controller_action == 'bookings_edit' || $controller_action == 'bookings_show' || $controller_action == 'booking_statuses_index' || $controller_action == 'booking_statuses_add' || $controller_action == 'booking_statuses_edit' || $controller_action == 'payment_types_index' || $controller_action == 'payment_types_add' || $controller_action == 'payment_types_edit'): ?>
        <li<?php echo $controller_action == 'bookings_index' ? ' class="active"' : ''; ?>><?php echo $this->Html->link('Xem tất cả bookings', array('controller' => 'bookings', 'action' => 'index')); ?></li>
        <li<?php echo $controller_action == 'bookings_add' ? ' class="active"' : ''; ?>><?php echo $this->Html->link('Tạo booking mới', array('controller' => 'bookings', 'action' => 'add')); ?></li>
        <li<?php echo $controller_action == 'booking_statuses_index' || $controller_action == 'booking_statuses_add' || $controller_action == 'booking_statuses_edit' ? ' class="active"' : ''; ?>><?php echo $this->Html->link('Quản lý tình trạng', array('controller' => 'booking_statuses', 'action' => 'index')); ?></li>
        <li<?php echo $controller_action == 'payment_types_index' || $controller_action == 'payment_types_add' || $controller_action == 'payment_types_edit' ? ' class="active last"' : ' class="last"'; ?>><?php echo $this->Html->link('Quản lý phương thức thanh toán', array('controller' => 'payment_types', 'action' => 'index')); ?></li>

        <?php elseif ($controller_action == 'customers_index' || $controller_action == 'customers_add' || $controller_action == 'customers_edit' || $controller_action == 'customers_show'): ?>
        <li<?php echo $controller_action == 'customers_index' ? ' class="active"' : ''; ?>><?php echo $this->Html->link('Xem tất cả khách hàng', array('controller' => 'customers', 'action' => 'index')); ?></li>
        <li<?php echo $controller_action == 'customers_add' ? ' class="active last"' : ' class="last"'; ?>><?php echo $this->Html->link('Tạo khách hàng mới', array('controller' => 'customers', 'action' => 'add')); ?></li>

        <?php elseif ($controller_action == 'hotels_index' || $controller_action == 'hotels_add' || $controller_action == 'hotels_edit' || $controller_action == 'locations_index' || $controller_action == 'locations_add' || $controller_action == 'locations_edit'): ?>
        <li<?php echo $controller_action == 'hotels_index' ? ' class="active"' : ''; ?>><?php echo $this->Html->link('Xem tất cả khách sạn', array('controller' => 'hotels', 'action' => 'index')); ?></li>
        <li<?php echo $controller_action == 'hotels_add' ? ' class="active"' : ''; ?>><?php echo $this->Html->link('Tạo khách sạn mới', array('controller' => 'hotels', 'action' => 'add')); ?></li>
        <li<?php echo $controller_action == 'locations_index' || $controller_action == 'locations_add' || $controller_action == 'locations_edit' ? ' class="active last"' : ' class="last"'; ?>><?php echo $this->Html->link('Quản lý địa điểm', array('controller' => 'locations', 'action' => 'index')); ?></li>

        <?php elseif ($controller_action == 'users_index' || $controller_action == 'users_add' || $controller_action == 'users_edit' || $controller_action == 'users_change_password'): ?>
        <li<?php echo $controller_action == 'users_index' ? ' class="active"' : ''; ?>><?php echo $this->Html->link('Xem tất cả users', array('controller' => 'users', 'action' => 'index')); ?></li>
        <li<?php echo $controller_action == 'users_add' ? ' class="active last"' : ' class="last"'; ?>><?php echo $this->Html->link('Tạo user mới', array('controller' => 'users', 'action' => 'add')); ?></li>

        <?php endif; ?>
    </ul>
</div>